<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('goods_id')->comment("主键ID");
            $table->string('goods_name',30)->comment("商品名称");
            $table->decimal('goods_price',8,2)->comment("商品价格");
            $table->string('goods_img')->comment("商品图片");
            $table->string('goods_mags',50)->comment("商品链接");
            $table->timestamps();
            $table->unique('goods_name','goods_name');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
